/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dados;

import net.sourceforge.floggy.persistence.Comparator;
import net.sourceforge.floggy.persistence.Persistable;

/**
 *
 * @author Glaucio
 */
public class OrdenacaoPorConta implements Comparator  {

  public int compare(Persistable p1, Persistable p2) {
    Conta c1 = (Conta) p1;
    Conta c2 = (Conta) p2;
    
    int c = c1.getNomeConta().compareTo(c2.getNomeConta());
    if (c > 0) return Comparator.PRECEDES;
    if (c < 0) return Comparator.FOLLOWS;

    return Comparator.EQUIVALENT;
  }
}
